import { defineConfig } from "vitepress";

const nav = [
  { text: "🐲主页", link: "/" },
  {
    text: '🍉指南',
    items: [
      {
        text: '介绍',
        items: [
          { text: '前言', link: '/docs/preface' },
        ],
      },
      {
        text: '入门知识',
        items: [
          { text: '快速上手', link: '/docs/started' },
          { text: '表结构说明', link: '/docs/tables' },
          { text: '流程设计器', link: '/docs/designer' },
          // { text: '其它', link: '/frontmatter' },
        ],
      },
      // {
      //   text: '进阶玩法',
      //   items: [
      //     { text: 'Markdown', link: '/markdown' },
      //     { text: '团队', link: '/team' },
      //     { text: '静态部署', link: '/assets' },
      //   ],
      // },
    ],
  },
  {
    text: "🍒配置",
    items: [
      { text: '流程设计器', link: '/docs/designer' },
    ],
  },
  { text: "❓问答", link: "/docs/qa" },
];

const sidebar = [
  {
    text: '介绍',
    collapsed: false,
    items: [
      { text: '前言', link: '/docs/preface' },
    ],
  },
  {
    text: '入门知识',
    collapsed: false,
    items: [
      { text: '快速上手', link: '/docs/started' },
      { text: '表结构说明', link: '/docs/tables' },
      { text: '流程设计器', link: '/docs/designer' },
      // { text: '其它', link: '/frontmatter' },
    ],
  },
  // {
  //   text: '进阶玩法',
  //   collapsed: false,
  //   items: [
  //     { text: 'Markdown', link: '/markdown' },
  //     { text: '团队', link: '/team' },
  //     { text: '静态部署', link: '/assets' },
  //   ],
  // },
  {
    text: '其他站点',
    collapsed: false,
    items: [
      { text: 'MybatisPlus', link: 'https://baomidou.com' },
      { text: '友情链接', link: '/docs/links' },
    ],
  },
];

const socialLinks = [

  { icon: "github", link: "https://github.com/aizuda/flowlong" },
  {
    icon: {
      svg: '<svg x="5" y="5" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23"></path></svg>',
    },
    link: "https://gitee.com/aizuda/flowlong",
  },
];

export default defineConfig({
  title: "FlowLong 飞龙工作流引擎",
  description: "真正的国产工作流引擎 json 格式实例模型、简易审批流程设计器、🚩为中国特色审批匠心打造❗",
  srcDir: "./src",
  assetsDir: "static",
  markdown: {
    lineNumbers: true,
  },
  head: [
      ['link', { rel: 'icon', href: '/favicon.ico'}],
      ['meta', { property: 'og:type', content: 'flowlong' }],
      ['meta', { property: 'og:title', content: 'FlowLong 飞龙工作流引擎' }],
      ['meta', { name: 'og:locale', content: 'cn' }],
      ['meta', { name: 'og:site_name', content: 'flowlong' }],
  ],
  themeConfig: {
    siteTitle: 'FlowLong',
    logo: '/logo.svg',
    search: {
      provider: "algolia",
      options: {
        appId: "...",
        apiKey: "...",
        indexName: "...",
      },
    },
    nav,
    sidebar,
    outline: {
      level: 'deep', // 右侧大纲标题层级
      label: '目录', // 右侧大纲标题文本配置
    },
    darkModeSwitchLabel: '切换亮色/暗黑模式',
    sidebarMenuLabel: '文章',
    returnToTopLabel: '返回顶部',
    lastUpdatedText: '最后更新',
    docFooter: {
      prev: '上一篇',
      next: '下一篇'
    },
    footer: {
      message: "更适合中国人的工作流引擎",
      copyright: "Copyright © 2023 FlowLong",
    },
    editLink: {
        pattern: 'https://gitee.com/aizuda/flowlong-docs',
        text: 'Edit this page on GitHub',
    },
    lastUpdated: {
      text: "最后更新",
      formatOptions: {
        dateStyle: "full",
        timeStyle: "medium",
      },
    },
    cleanUrls: true,
    ignoreDeadLinks: true,
    // carbonAds: {
    // code: 'your-carbon-code',
    // placement: 'your-carbon-placement'
    // },
    socialLinks,
  },
});
